package day10;

import day9.java86.Dog;
import day9.java86.Pet;
import day9.java86.Qie;

/**
 * @author oldliu
 * @since 1.0
 */
//宠物医生
public class PetDoctor {
    private String name;

    public PetDoctor(String n) {
        this.name = n;
    }
    //治疗：假如是老虎，把嘴捆起来
    public void zhiliao(Pet p) {
        System.out.println(name + "给宠物" + p.getName() + "检查");
        if(p instanceof Tiger){
            System.out.println("把"+p.getName()+"嘴捆起来");
        }
        if(p instanceof Dog){
            System.out.println("抓个老鼠：");
            Dog d=(Dog)p;
            d.catchMouse("小灰灰");
            //((Dog) p).catchMouse("小灰灰");
        }
        p.print();
        System.out.println("没病，走两步");
        System.out.println("打针吃药，一千二");
    }
//    public void zhiliao(Dog d){
//        System.out.println(name+"给宠物"+d.getName()+"检查");
//        System.out.println("没病，走两步");
//    }
//    public void zhiliao(Qie d){
//        System.out.println(name+"给宠物"+d.getName()+"检查");
//        System.out.println("没病，走两步");
//    }
}
